public class Solution2309 {
    public String greatestLetter(String s) {
        for (int i=25;i>=0;i--){
            if (s.contains(String.valueOf((char)('a'+i))) && s.contains(String.valueOf((char)('A'+i)))){
                return String.valueOf((char)('A'+i));
            }
        }
        return "";
    }

    public static void main(String[] args) {
        System.out.println(new Solution2309().greatestLetter("lEeTcOdE"));
    }
}
